class number:   #编写number类
    __result = 0    #命名__result成员变量

    def __Total(self, n):    #计算1至n的和
        for i in range(1, (n + 1)):
            self.__result += i

    def GetResult(self, n): #存储结果
        self.__Total(n)
        return self.__result


if __name__ == '__main__':
    sum = number()
    n = int(input("请输入需要求和的数字: "))
    if n == 0:
        print("0")
    elif n == 1:
        print("%d的和是：%d" % (n, sum.GetResult(n)))
    elif n == 2:
        print("1+%d的和是：%d" % (n, sum.GetResult(n)))
    elif n == 3:
        print("1+2+%d的和是：%d" % (n, sum.GetResult(n)))
    else:
        print("1+2+....+%d的和是：%d" % (n, sum.GetResult(n)))
